export default {
    routerTo(path, isTabbar) {
		if (path) {
			// 是否跳转外部链接
			if (~path.indexOf('http') || ~path.indexOf('www')) {
				// #ifdef H5
				window.location = path;
				// #endif
				// #ifndef  H5
				router.push({
					path: '/pages/public/webview',
					query: {
						'webviewPath': path
					}
				})
				// #endif
				return false
			}
			if (isTabbar) {
				router.replaceAll(path)
			} else {
				path.includes('/pages/index') && !path.includes('/pages/index/view') ? router.replaceAll(path) : router
					.push(path)
			}

		} else {
			console.log(`%cerr:没有填写跳转路径`, 'color:green;background:yellow');
		}
	},
    splitData(oArr = [], length = 1) {
        let arr = [];
        let minArr = [];
        oArr.forEach(c => {
            if (minArr.length === length) {
                minArr = [];
            }
            if (minArr.length === 0) {
                arr.push(minArr);
            }
            minArr.push(c);
        });

        return arr;
    }
}